package util

/**
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: 24.3.11
 * Time: 21:02
 * To change this template use File | Settings | File Templates.
 */

class NamedFunction1[-T1, +R](name: String, fn: Function1[T1, R]) extends Function1[T1, R] {

  def apply(v1: T1) = fn(v1)

  override def toString() = name
}

class NamedFunction2[-T1, -T2, +R](name: String, fn: Function2[T1, T2, R]) extends Function2[T1, T2, R] {

  def apply(v1: T1, v2: T2) = fn(v1, v2)

  override def toString() = name
}

class NamedFunction3[-T1, -T2, -T3, +R](name: String, fn: Function3[T1, T2, T3, R]) extends Function3[T1, T2, T3, R] {

  def apply(v1: T1, v2: T2, v3: T3) = fn(v1, v2, v3)

  override def toString() = name
}